#ifndef _VOICE_H
#define _VOICE_H
#include "define.h"

#define VOICE_100_US_COUNT 1                       // 独立计时器 时间单位定义
#define VOICE_1_MS_COUNT (VOICE_100_US_COUNT * 10) //
#define VOICE_SHORT_DELAY_COUNT VOICE_100_US_COUNT // 语音发送协议的短延时 推荐值 100us
#define VOICE_LONG_DELAY_COUNT VOICE_100_US_COUNT  /// 语音发送协议的长延时 推荐值 1ms

typedef enum e_voice_cmd
{
    VOICE_CMD_NO_VOICE_STOP_VOICE = 1,          //无语音停止语音播放
    VOICE_CMD_INSUFFICIENT_POWER = 2,           //电力不足
    VOICE_CMD_PLEASE_KEEP_QUIET = 3,            //请保持安静 , 现在准备开始测量血压
    VOICE_CMD_END_OF_MEASUREMENT = 4,           //测量结束
    VOICE_CMD_HIGH_PRESSURE_IS = 5,             //高压是
    VOICE_CMD_LOW_PRESSURE_IS = 6,              //低压是
    VOICE_CMD_MEAN_BLOOD_PRESSURE = 7,          //平均血压
    VOICE_CMD_HEARTBEATS_PER_MINUTE_IS = 8,     //每分钟心跳次数是
    VOICE_CMD_MM_HG = 9,                        //毫米汞柱
    VOICE_CMD_KILOPASCAL = 10,                  //千帕
    VOICE_CMD_SPOT = 11,                        //点
    VOICE_CMD_TIME = 12,                        //次
    VOICE_CMD_YOUR_BLOOD_PRESSURE = 13,         //您的血压
    VOICE_CMD_NORMAL = 14,                      //正常
    VOICE_CMD_ON_THE_HIGH_SIDE = 15,            //偏高
    VOICE_CMD_ON_THE_LOW_SIDE = 16,             //偏低
    VOICE_CMD_ABNORMAL = 17,                    //异常
    VOICE_CMD_ERROR_DETECTED = 18,              //测量时，侦测到错误
    VOICE_CMD_IRREGULAR_HEART_RATE_DETECT = 19, //测量时，侦测到心率不齐
    VOICE_CMD_THANK_YOU_FOR_YOUR_USE = 20,      //谢谢您的使用 , 祝您健康
    VOICE_CMD_NUMBER_OFFSET = 21,               //语音芯片数字的偏移量 0
    VOICE_CMD_TEN = 31,                         //十
    VOICE_CMD_HUNDRED = 32,                     //百
    BEEP0 = 33,
    BEEP1 = 34,
} e_voice_cmd_typedef;

typedef enum e_pres_unit // 血压单位
{
    PRES_UNIT_MMG = 0,
    PRES_UNIT_KPA,
    PRES_UNIT_HEARTBEAT, // 特殊处理 心跳次数

}e_pres_unit_typedef;

//lx
typedef enum e_pres_unit1 // 血压单位
{
    _mmg = 0,
    _kp,

}e_pres_unit1_typedef;

extern /*bit*/ char g_flag_voice_on; // 开始发送数据标志位

void delay_100us(void);
void delay_500us(void);
void delay_1ms(void); // 死延时 执行空指令
void voice_init(void);
void voice_start(void); //
void voice_send_cmd(u8 e_voice_cmd);
void voice_combine_cmd(e_pres_unit_typedef e_pres_unit11, u8 sys, u8 dia, u8 pul);
void voice_combine_cmd_start_play(void);
void voice_stop_play_clear_queue(void);
void voice_add_cmd(u8 e_voice_cmd);
void voice_combine_cmd_wholevel(u8 wholevel);
void voice_devide_number_pro(e_pres_unit_typedef e_pres_unit, u16 number);
void new_cn_ic_voice_send_cmd_server(unsigned char e_voice_cmd);
void new_cn_ic_voice_send_combine_cmd_server(void);
void voicezh_combine_cmd(e_pres_unit1_typedef e_pres_unit1, u8 number1, u8 number2, u8 number3);

#endif